<!DOCTYPE HTML>
<link rel="stylesheet" href="css/head.css"/>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="js/base-v1.js" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery-1.2.6.min.js" charset="utf-8"></script>
<script type="text/javascript" src="js/cookie.js" charset="utf-8"></script>
<script type="text/javascript" src="js/common.js" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery.cookie.js" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery.min.js" charset="utf-8"></script>

<script type="text/javascript">
    window.onload=
        function(){
            let _ticket = $.cookie("EM_TICKET");
            if(!_ticket){
                return ;
            }
            //当dataType类型为jsonp时，jQuery就会自动在请求链接上增加一个callback的参数
            $.ajax({
                url : "http://www.supermarket.com/user/query/" + _ticket,
                dataType : "json",
                type : "GET",
                success : function(data){
                    if(data.status === 200){
                        let _data = JSON.parse(data.data);//jackson
                        let html =_data.userName+"，欢迎来到Supermarket！<a href=\"http://www.easymall.com/user/logout\" class=\"link-logout\">[退出]</a>  \|<a href=\"http://www.easymall.com/page/manage\" class=\"link-logout\">[后台]</a>";
                        $("#loginbar").html(html);
                    }
                },
                error : function(){
                    alert('index error.');
                }
            });
        }
    function search(a) {
        let b = "http://web.supermarket.com/search.html?q=" + encodeURIComponent(document.getElementById(a).value);
        return window.location.href = b;
    }
</script>
<div id="common_head">
    <div class="line1">
        <div class="content">
            <ul>
                <li class="fore1" id="loginbar" clstag="homepage|keycount|home2013|01b">
                    <span id="head_span">
                        <a href="views/login.html">登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                        <a href="views/regist.html">注册</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                        <a href="views/manage.html">后台</a>
                    </span>
                </li>
            </ul>
        </div>
    </div>
    <div class="line2">
        <img id="logo" src="img/head/logo.png" alt="logo"/>
        <input type="text" value="" accesskey="s" id="key" autocomplete="off" onkeydown="if(event.keyCode===13) search('key');"/>
        <input type="button" value="搜 索" onclick="search('key');return false;"/>
        <span id="goto">
			<a id="goto_order" href="/web/myorder">我的订单</a>
			<a id="goto_cart" href="/web/mycart">我的购物车</a>
		</span>
        <img id="erwm" src="img/head/e2.png" width="76" alt="e2"/>
    </div>
    <div class="line3">
        <div class="content">
            <ul>
                <li><a href="./index.html">首页</a></li>
                <li><a href="./product-list.html?page=1&rows=5">全部商品</a></li>
                <li><a href="/web/sekill/list">秒杀商品</a></li>
                <li><a href="#">电脑平板</a></li>
                <li><a href="#">家用电器</a></li>
                <li><a href="#">汽车用品</a></li>
                <li><a href="#">食品饮料</a></li>
                <li><a href="#">图书杂志</a></li>
                <li><a href="#">服装服饰</a></li>
                <li><a href="#">大英理财</a></li>
            </ul>
        </div>
    </div>
</div>
